Skip to main content

Label Class

Description:

  A class for creating Label object.

AutomaticWidth

Type: Readonly Field.

Description:

  The value to use for automatic width calculation

Signature:

const AutomaticWidth: number

__call

Type: Metamethod.

Description:

  Creates a new Label object with the specified font name and font size.

Signature:

metamethod __call: function(self: LabelClass, fontName: string, fontSize: integer): Label | nil

Parameters:

ParameterTypeDescription
fontNamestringThe name of the font to use for the label.Can be font file path with or without file extension.
fontSizeintegerThe size of the font to use for the label.

Returns:

Return TypeDescription
Label | nilThe new Label object, or nil if the font could not be loaded.